<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人和人律师事务所管理系统v1.0-律师信息查询</title>

<style type="text/css" media="all">
    .allow-float {clear:none!important;} /* 允许该元素浮动 */
    .stop-float {clear:both!important;} /* 阻止该元素浮动 */
	.float-left {float:left;padding-left:40px}   /*浮动到左边*/
  </style>

<!-- 引入外部修改律师信息js文件 -->
<script type="text/javascript" src="userSearchJs/modify_lawyer_info.js"></script>
<!-- 引入外部删除律师信息js文件 -->
<script type="text/javascript" src="userSearchJs/delete_lawyer_info.js"></script>

<script type="text/javascript">
Ext.onReady(function(){
	Ext.BLANK_IMAGE_URL = '/ext/resources/images/default/s.gif';
    Ext.QuickTips.init();
	//设定超时时间
    Ext.Ajax.timeout=120000;
    Ext.form.Field.prototype.msgTarget = 'side';
    //查询框
    var searchWindow = new Ext.form.FormPanel({
			title:'律师信息查询',
			labelAlign:'right',
			labelSeparator :'：',//分隔符
			labelWidth : 80,//标签宽度
			bodyStyle:'padding:5',//表单边距
			frame : true,
			collapsible: true,
			height:100,
			width:window.screen.width-225,
			applyTo :'searchWin',

			items:[
				new Ext.form.TextField({
					fieldLabel : '律师姓名',
					id : 'lawyerName',
					name : 'lawyerName',
					width:(window.screen.width-320)*0.18,
					itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
					selectOnFocus : true,//得到焦点时自动选择文本
					allowBlank : true
				}),

				new Ext.form.TextField({
					fieldLabel : '职位',
					id : 'positionName',
					name : 'positionName',
					width:(window.screen.width-320)*0.18,
					itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
					selectOnFocus : true,//得到焦点时自动选择文本
					allowBlank : true
				}),

				new Ext.Button({
					text : '开始查询',
					iconCls:'search',
					cls:'float-left',//向左浮动
					handler : submitMsg
				})
			]
		})

		//查询处理函数
	function submitMsg(){
		var lawyerName=Ext.getCmp("lawyerName").getValue();
		var positionName=Ext.getCmp("positionName").getValue();
		//判断是否输入了查询条件
		if(lawyerName==""&&positionName==""){
		Ext.Msg.alert('提示','请输入查询条件');
		return;
		}
		 store = new Ext.data.JsonStore({
	url:"SearchLawyerInfo.jsj?lawyerName="+lawyerName+"&positionName="+positionName,
	totalProperty: 'totalCount',
    root: 'result',
	fields:["lawyerid","lawyername","birthtime","lawyersex","politicalstatus","businessnumber","businesyear",
	"honestarchives","lawyerphone","educationallevel","identitynumber","annsurreginfo",
	"positionname","graduateschool","lawyeremail","lawyercometime","lawyerleavetime","lawyerachriveinfo","householdaddr","achriveaddr","eligiblenumber"]
});
		store.reload({
			params:{
				start:0,
				limit:5
				}
			});
		var colModel = new Ext.grid.ColumnModel([//配置表格列
				new Ext.grid.RowNumberer({
					header : '行号',
					width : 40
				}),
				cb,
				{header: "律师ID", width: 75, dataIndex: 'lawyerid', sortable: true},
				{header: "律师姓名", width: 100, dataIndex: 'lawyername', sortable: true},
				{header: "出生年月", width: 100, dataIndex: 'birthtime', sortable: true},
				{header: "性别", width: 75, dataIndex: 'lawyersex', sortable: true},
				{header: "政治面貌", width: 100, dataIndex: 'politicalstatus', sortable: true},
				{header: "执业证号", width: 120, dataIndex: 'businessnumber', sortable: true},
				{header: "执业年限", width: 100, dataIndex: 'businesyear', sortable: true},
				{header: "诚信档案", width: 100, dataIndex: 'honestarchives', sortable: true},
				{header: "联系方式", width: 150, dataIndex: 'lawyerphone', sortable: true},
				{header: "文化程度", width: 100, dataIndex: 'educationallevel', sortable: true},
				{header: "身份证号", width: 150, dataIndex: 'identitynumber', sortable: true},
				{header: "年检注册情况", width: 100, dataIndex: 'annsurreginfo', sortable: true},
				{header: "职位名", width: 150, dataIndex: 'positionname', sortable: true},
				{header: "毕业院校", width: 150, dataIndex: 'graduateschool', sortable: true},
				{header: "入所时间", width: 150, dataIndex: 'lawyercometime', sortable: true},
				{header: "离所时间", width: 150, dataIndex: 'lawyerleavetime', sortable: true},
				{header: "异动情况", width: 200, dataIndex: 'lawyerachriveinfo', sortable: true},
				{header: "户籍所在地", width: 150, dataIndex: 'householdaddr', sortable: true},
				{header: "档案所在地", width: 150, dataIndex: 'achriveaddr', sortable: true},
				{header: "资格证号", width: 150, dataIndex: 'eligiblenumber', sortable: true},
				]);
				pagebar.bind(store);
				grid.reconfigure(store,colModel);
				grid.getView().refresh(true);
	}

    //存储器
		var store = new Ext.data.JsonStore({
	url:"LawyerInfoRequest.jsj",
	totalProperty: 'totalCount',
	root: 'result',
fields:["lawyerid","lawyername","birthtime","lawyersex","politicalstatus","businessnumber","businesyear",
	"honestarchives","lawyerphone","educationallevel","identitynumber","annsurreginfo",
	"positionname","graduateschool","lawyeremail","lawyercometime","lawyerleavetime","lawyerachriveinfo","householdaddr","achriveaddr","eligiblenumber"]
});
		store.load({
			params:{
				start:0,
				limit:5
				}
			});

	//获得用户权限
		var buttonDisabled=true;
	<%
	if((java.lang.Integer)session.getAttribute("popedomLevel")==1){
		%>
		buttonDisabled=false;
	<%
	}
	%>

		//创建工具栏组件
		var toolbar = new Ext.Toolbar([
			{text : '律师基本信息'},
			'-',
			{
			text:'修改选定律师信息',
			iconCls:'option',
			disabled:buttonDisabled,
			handler:function(btn,pressed){
			modifyLawyerInfo(grid,store);
			}
			},
			'-',
			{
			text:'删除选定律师信息',
			iconCls:'remove',
			disabled:buttonDisabled,
			handler:function(btn,pressed){
			deleteLawyerInfo(grid,store);
			}
			}
		]);





		//分页工具栏
		var pagebar = new Ext.PagingToolbar({
			store : store,
			pageSize : 5,
			displayInfo : true,
			displayMsg : '第 {0} ~ {1} 条 共 {2} 条',
			emptyMsg : '当前没有记录'
		});
		//创建选择模式对象
	var cb = new Ext.grid.CheckboxSelectionModel()
	//创建Grid表格组件
	var grid = new Ext.grid.GridPanel({
			renderTo : 'grid-div',
			frame : true,
			tbar : toolbar,
			bbar : pagebar,
			trackMouseOver:true, //鼠标特效
			loadMask: true,    //是否显示正在加载
			store : store,
			height : 280,
			width : window.screen.width-220,
			stripeRows : true,
			autoScroll : true,
			viewConfig : {autoFill : false},
			sm : cb,
			columns: [//配置表格列
				new Ext.grid.RowNumberer({
					header : '行号',
					width : 40
				}),
				cb,
				{header: "律师ID", width: 75, dataIndex: 'lawyerid', sortable: true},
				{header: "律师姓名", width: 100, dataIndex: 'lawyername', sortable: true},
				{header: "出生年月", width: 100, dataIndex: 'birthtime', sortable: true},
				{header: "性别", width: 75, dataIndex: 'lawyersex', sortable: true},
				{header: "政治面貌", width: 100, dataIndex: 'politicalstatus', sortable: true},
				{header: "执业证号", width: 120, dataIndex: 'businessnumber', sortable: true},
				{header: "执业年限", width: 100, dataIndex: 'businesyear', sortable: true},
				{header: "诚信档案", width: 100, dataIndex: 'honestarchives', sortable: true},
				{header: "联系方式", width: 150, dataIndex: 'lawyerphone', sortable: true},
				{header: "文化程度", width: 100, dataIndex: 'educationallevel', sortable: true},
				{header: "身份证号", width: 150, dataIndex: 'identitynumber', sortable: true},
				{header: "年检注册情况", width: 100, dataIndex: 'annsurreginfo', sortable: true},
				{header: "职位名", width: 150, dataIndex: 'positionname', sortable: true},
				{header: "毕业院校", width: 150, dataIndex: 'graduateschool', sortable: true},
				{header: "入所时间", width: 150, dataIndex: 'lawyercometime', sortable: true},
				{header: "离所时间", width: 150, dataIndex: 'lawyerleavetime', sortable: true},
				{header: "异动情况", width: 200, dataIndex: 'lawyerachriveinfo', sortable: true},
				{header: "户籍所在地", width: 150, dataIndex: 'householdaddr', sortable: true},
				{header: "档案所在地", width: 150, dataIndex: 'achriveaddr', sortable: true},
				{header: "资格证号", width: 150, dataIndex: 'eligiblenumber', sortable: true},
				]
		});
});

</script>
</head>
<body>
<table><tr><td>
<div id='searchWin' style="margin:8px 8px 4px 8px"></div>
</td></tr>
</table>
<div id='grid-div' style="margin:4px 8px 8px 8px"></div>


</body>
</html>